<script setup>
import {  ref } from 'vue'
import router from './router.js'

let list = ref([])
let list2 = router.getRoutes()
list2 = list2.filter(item => item.name)
list.value = list2.map(item => {
  return {
    name: item.name,
    path: item.path
  }
})
</script>

<template>
  <div class="greetings">
     <el-menu
        router
      >
        <el-menu-item v-for="item in list" :index="item.path">
          <el-icon><document /></el-icon>
          <span>{{item.name}}</span>
        </el-menu-item>
      </el-menu>
  </div>
</template>

<style scoped>

</style>
